﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master.master" AutoEventWireup="true" CodeFile="detail.aspx.cs" Inherits="image_detail" %>

<%@ Register src="../ascx/UserInfo.ascx" tagname="UserInfo" tagprefix="uc1" %>

<%@ Register src="../ascx/Music.ascx" tagname="Music" tagprefix="uc2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="Server">
    <link rel="stylesheet" href="/style/liuy.css" type="text/css" media="screen" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Content" runat="Server">
    <div class="k66">
        <div class="Struct">
            <div class="Title">
                <h2><%= img.Title %></h2>
                <div class="Info">
                    <a href="#"><%= img.UserName %></a>&nbsp;&nbsp;&nbsp;发布于<%= base.DateBefore(img.AddTime)%></div>
            </div>
            <div class="Content">
                <a href="<%= base.GetImage(img.Pic) %>" title="<%= img.Title %>" class="thickbox">
                    <img src="<%= base.GetImage(img.Pic) %>" alt="<%= img.Title %>" title="<%= img.Title %>"  /></a>
                    <p class="ps"><%= img.Content %></p>
                <div class="tools">
                    <li>
                        <img src="/images/gif-0999.gif" align="absmiddle" border="0" alt="喜欢" />
                        <a href="javascript:LoveIn(<%= img.ID %>);">喜欢</a></li>
                    <li>
                        <img src="/images/gif-0168.gif" align="absmiddle" border="0" alt="收藏" />
                        <a href="javascript:Shou(<%= img.ID %>);">收藏</a></li>
                    <li>
                        <img src="/images/gif-0560.gif" align="absmiddle" border="0" alt="举报" />
                        <a href="#"  onclick="Jubao();">举报</a></li>
                    <li>
                        <img src="http://v.t.qq.com/share/images/s/weiboicon16.png" align="absmiddle" border="0" alt="转播到腾讯微博" />
                        <a href="javascript:void(0)" onclick="postToWb();return false;" style="height: 16px; font-size: 12px; line-height: 16px;">转播到腾讯微博</a>
                            <script type="text/javascript">
                                function postToWb() {
                                    var _url = encodeURIComponent(document.location);
                                    var _assname = encodeURI("4254636"); //你注册的帐号，不是昵称
                                    var _appkey = encodeURI("9ccd0ef13b711f72e143b76ed1c4dc42"); //你从腾讯获得的appkey
                                    var _pic = encodeURI(''); //（例如：var _pic='图片url1|图片url2|图片url3....）
                                    var _t = ''; //标题和描述信息
                                    var metainfo = document.getElementsByTagName("meta");
                                    for (var metai = 0; metai < metainfo.length; metai++) {
                                        if ((new RegExp('description', 'gi')).test(metainfo[metai].getAttribute("name"))) {
                                            _t = metainfo[metai].attributes["content"].value;
                                        }
                                    }
                                    _t = document.title + _t; //请在这里添加你自定义的分享内容
                                    if (_t.length > 120) {
                                        _t = _t.substr(0, 117) + '...';
                                    }
                                    _t = encodeURI(_t);

                                    var _u = 'http://share.v.t.qq.com/index.php?c=share&a=index&url=' + _url + '&appkey=' + _appkey + '&pic=' + _pic + '&assname=' + _assname + '&title=' + _t;
                                    window.open(_u, '', 'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no');
                                }
                            </script>
                    </li>
                </div>
                <!--kais-->
                <div id="comments">
                    <div id="cmtswitcher">
                        <a href="#">发布评论</a> <a id="commenttab" class="curtab" href="javascript:void(0);">评论 (<%=CommentCount %>)</a><div class="clear">
                            </div>
                    </div>
                    <div id="comment_div">
                        <div id="comment_head">
                            各位正在萝莉的同学请注意，有 <span><%=CommentCount%> 位**人士</span> 在萝莉国度偷拍艳照！</div>
                        <ul id="thecomments" class="commentlist">

                            <asp:Repeater ID="rptLiuyan" runat="server">
                            <ItemTemplate>
                            <li class="comment" id="comment-77981">
                                <div class="comment_body">
                                    <div class="comment_meta">
                                        <div><img class="avatar" width="50" alt="<%# Eval("UserName") %>" height="50" src="<%# base.GetImage(Eval("Pic")) %>" /></div>
                                        <span><%# Eval("UserName") %></span></div>
                                    <div class="comment_content">
                                        <p><%# Eval("Content") %></p>
                                        <div class="comm_meta_div">
                                            <span class="commentmetadata"><a class='comment-reply-link'  style="cursor:hand;"  onclick='toComment(<%# Eval("ID") %>,"<%# Eval("UserName") %>");'>回复他/她 &raquo;&nbsp;&nbsp;</a></span>
                                            <%# GetFunnyComment((Container.ItemIndex + 1) + (base.PageIndex - 1) * base.PageSize)%> [<%# Eval("AddTime") %>]
                                        </div>
                                    </div>
                                </div>
                                <%# GetChildComment(Eval("ID"))%>
                            </li>    
                            </ItemTemplate>
                            </asp:Repeater>
                            <my:aspnetpager class="arPage" PageSize="6" UrlPaging="true" 
                                runat="server" ID="pgServer" 
                                CustomInfoHTML="共%PageCount%页记录<span>|</span>每页<em>%PageSize%</em>条<span>|</span>当前第<em>%CurrentPageIndex%</em>页" 
                                FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页" 
                                ShowCustomInfoSection="Left" Height="18px" >
                            </my:aspnetpager>
                        </ul>
                    </div>
                    <div class="clear">
                    </div>
                    <div id="comment_foot"> 小X的哥哥的同学的老师的儿子的妈妈养的小猫的表弟的主人的朋友说看帖不回会被鄙视de</div>
                    <div id="commentlogin" runat="server">
                        <a href="javascript:shologin();;">请您登录后留言</a>
                    </div>
                    <div id="respond" runat="server">
                        <div id="respond-contain">
                            <div id="cancel-comment-reply">
                                <a rel="nofollow" id="cancel-comment-reply-link" href="/soluto.html#respond" style="display: none;">
                                    点击这里取消回复。</a></div>
                            <div id="comment-txt-input"><span id="spanTo"></span>
                                评论内容 (*必填)：<br />
                                <textarea class="comment-area" name="comment" id="comment" cols="100%" rows="14"
                                    tabindex="4"></textarea></div>
                            <div class="comment-set-avatar">
                                <div id="set-avatar">
                                    <img src="<%=UserImage %>" width="50" height="50" alt=""></div>&nbsp;</div>
                            <div class="comment_btn">&nbsp;&nbsp;&nbsp;
                            <input name="submit" type="submit" id="submit" onclick="return checkComment();" tabindex="5" value="留下我的足迹..." /></div>
                            <input type='hidden' name='comment_img' id='comment_img' value='<%= id %>' />
                            <input type='hidden' name='comment_parent' id='comment_parent' value='0' />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="k34">
        
        <uc1:UserInfo ID="UserInfo1" runat="server" />

        <div class="Box">
            <div class="Title">
                Ta们也喜欢</div>
            <div class="Main User_Thumb">
                <asp:Repeater ID="rptUser" runat="server">
                <ItemTemplate> <a href="/user/<%# Eval("ID") %>.html" title="<%# Eval("UserName") %>"><img src="<%# base.GetImage(Eval("UserPic")) %>" width="50" height="50" alt="<%# Eval("UserName") %>" /></a></ItemTemplate>
                </asp:Repeater>
            </div>
        </div>
        <uc2:Music ID="Music1" runat="server" />
        <div class="Box">
            <div class="Title">您还可能喜欢</div>
            <div class="Main Right_Thumbnail">
                <asp:Repeater ID="rptOtherImg" runat="server">
                <ItemTemplate><a href="/image/<%# Eval("ID") %>.html" title="<%# Eval("Title") %>"><img src="<%# base.GetSImagae(Eval("Pic")) %>" width="127" height="110" alt="<%# Eval("Title") %>" /></a></ItemTemplate>
                </asp:Repeater>
            </div>
        </div>
        
    </div>

    <script type="text/javascript">
        $(document).ready(function () {
            var cms = $('.comment_content');
            cms.mouseover(function () {
                var span = $(this).find("span");
                if (span != null) span.show();
            });
            cms.mouseout(function () {
                var span = $(this).find("span");
                if (span != null) span.hide();
            });
        });
        function toComment(i, name) {
            $('#spanTo').text("To:" + name);
            $('#comment_parent').val(i);
            $('#comment').focus();
        }
        function checkComment() {

            var comment = escape($.trim($('#comment').val()));
            if (comment == "") {
                alert("请输入留言内容");
                $('#comment').focus();
            }
            else {
                var url = "/ajax/image.aspx?type=liuyan&id=" + $('#comment_img').val() + "&parent=" + $('#comment_parent').val() + "&comment=" + comment + "&rd=" + Math.random();
                var html = $.ajax({
                    url: url,
                    async: false
                }).responseText;
                if (html == "") {
                    shologin();
                }
                else if (html == 1) {
                    alert("留言成功");
                    window.location.href = window.location.href;
                }
                else {
                    alert("留言失败，请稍后重试！");
                }
            }
            return  false;
        }
    </script>
</asp:Content>

